# This Python file uses the following encoding: utf-8
import os
import os.path
from tkinter.filedialog import *
import shutil as st

file = askopenfilename(title='选择一个文件进行加密', filetypes=[('python文件', '.py'), ('python文件', '.pyw')])
file_path = os.path.dirname(file)
print(file)
print(file_path)
file_name = os.path.basename(file)
try:
    os.mkdir(file_path + "/" + file_name.split(".")[0])
    print(file_path + "/" + file_name.split(".")[0])
except FileExistsError:
    pass
st.copyfile(file, file_path + "/" + file_name.split(".")[0])
